#include "TestFailure.h"

#include <stdio.h>
#include <string.h> 
#include <stdarg.h>

CPPUNITLITE3_NS_BEGIN;

TestFailure::TestFailure (const char* theTestName, 
         const char*          theFileName, 
         int                         theLineNumber, 
         char *fmt, ...)
: testName (theTestName), 
  fileName (theFileName), 
  lineNumber (theLineNumber)
{
    va_list ap;// typedef char *  va_list;
    va_start(ap, fmt);//#define va_start(ap,v)  ( ap = (va_list)&v + _INTSIZEOF(v) )
    vsprintf(message, fmt, ap );
    va_end( ap);   //#define va_end(ap)      ( ap = (va_list)0 )
}

const char* TestFailure::getMessage() const 
{
    return message;
}

const char* TestFailure::getTestName() const 
{
    return testName;
}

const char* TestFailure::getFileName() const 
{
    return Basename(fileName);
}

int TestFailure::getLineNumber() const 
{
    return lineNumber;
}

CPPUNITLITE3_NS_END;

